﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class admin_chat : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["userid"] == null)
        {

            Response.Redirect("../Default.aspx");
        }
        else
        {
            if (!Page.IsPostBack)
            {
                restricted();
            }
            else
            {
                Response.Redirect(Request.UrlReferrer.ToString());
            }
        }
    }

    public void restricted()
    {
        long permiso = 0;
        rUser user = (rUser)(Session["userid"]);
        if (user != null)
        {
         
            RE_GenericBean permi = Utility.getPermisobyRuser(user, 4);
            permiso = permi.int64C2;
        }
        if ((permiso & 1) == 1) { Response.Redirect(Request.UrlReferrer.ToString()); }

        else { Response.Write("<script type='text/javascript'>window.open('sparkweb/SparkWeb.html','cal','width=450,height=700,left=20,top=20,scrollbars=YES,resizable=YES');</script>"); }
    }
}